
package com.uuah.server.api.agent;

import javax.management.InstanceAlreadyExistsException;
import javax.management.InstanceNotFoundException;
import javax.management.MBeanRegistrationException;
import javax.management.NotCompliantMBeanException;
import javax.management.ObjectInstance;
import javax.management.ObjectName;

import com.uuah.api.INamedObject;
import com.uuah.api.lifecycle.ILifecycle;

/**
 *
 * @author <a href="jonny_quan@hotmail.com">jonny</a>
 * @date 2008 2008-11-4 11:00:01
 * @version 1.0.0
 */
public interface IAgent extends ILifecycle, INamedObject {

	String getDescription();

	/**
	 * register Mbean
	 *
	 * @param object
	 * @param objectName
	 * @return
	 * @throws InstanceAlreadyExistsException
	 * @throws MBeanRegistrationException
	 * @throws NotCompliantMBeanException
	 */
	public ObjectInstance registerMBean(Object object, ObjectName objectName)
			throws InstanceAlreadyExistsException, MBeanRegistrationException,
			NotCompliantMBeanException;

	/**
	 * Register MBean
	 *
	 * @param object
	 * @param objectName
	 * @param dynamic
	 * @return
	 * @throws InstanceAlreadyExistsException
	 * @throws MBeanRegistrationException
	 * @throws NotCompliantMBeanException
	 */
	public ObjectInstance registerMBean(Object object, ObjectName objectName,
			boolean dynamic) throws InstanceAlreadyExistsException,
			MBeanRegistrationException, NotCompliantMBeanException;

	/**
	 * unRegister MBean
	 *
	 * @param name
	 * @throws InstanceNotFoundException
	 * @throws MBeanRegistrationException
	 */
	public void unregisterMBean(ObjectName name)
			throws InstanceNotFoundException, MBeanRegistrationException;

	/**
	 * start All MBean
	 */
	public void startAllMBeanFinally();

}
